Attachments Missing in Native App

3587
3
05-18-2016 12:09 PM
DBCooper
New Contributor

So I have a number of maps on Arc GIS online that have geodatabase attachments (PDFs, charts, etc). When I migrate these maps to AppStudio for Arc GIS, the attachments are now missing. Is there a setting to enable attachments that I just haven't been able to find?

0 Kudos
3 Replies
SathyaPrasad
Esri Contributor

Can you give a bit more information?

- What are you adding to your app: Webmap or Feature Service?

- What do you mean by attachments are missing - You cannot see attachments or how to query for attachments?

If you are working with a feature service directly, check out the attachment sample app which shows how to get and add attachments from a feature service.

0 Kudos
DBCooper
New Contributor

Thanks! I've been working with the attachment editor for a few days. I've hit a snag trying to change the display text of the attachments.  I want to strip a number of characters from the front of the string, and a number of characters from the end and keep everything in between.

For example: "Text_text_text_for_LOCATION_(text).png." I want to strip everything but LOCATION

Here is the code I've been working with in QT:

            Text {

                text: name.substr(22, name.length()-14);

                wrapMode: Text.WrapAtWordBoundaryOrAnywhere

            }

I've found this substring formatting mentioned on multiple sites, but I just can't get it to work. I keep getting LOCATION_(text).png

0 Kudos
nakulmanocha
Esri Regular Contributor

I am assuming your "LOCATION" value  varies with attachments. Otherwise you can just hard code the name as "LOCATION"

FOR instance aa_bb_cc_for_Kansas_(ss).png & ffff_sss_ee_for_Redlands_(eer).png.

If this is how your attachments are, then you could use the following split method

text: name.split('_')[name.split('_').length -2]

This assumes that you have no "_" in "LOCATION" value and also you have  exactly one more "_" after the "LOCATION" value.

If not then we need to change the logic for attachment name extraction. In that case please provide more examples of your attachments.

-Nakul

0 Kudos