port over widget config to different app

3139
9
Jump to solution
06-13-2016 11:22 AM
LeoLadefian5
Occasional Contributor II

I have tediously configured a query widget for one app, and I'd like to port it over to another.  I've tried copying the widget config and widget to the new app to no avail.  Is there a procedure for this?

Regards,

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Leo,

  Add the query widget to the new app like you are starting from scratch. In the widget setting dialog make some change (no matter what as long as you get the save option enabled in the main WAB app). Save the app and then replace the json file in the apps configs/query/config_Query.json with the one you configured in your previous app.

View solution in original post

9 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Leo,

  Add the query widget to the new app like you are starting from scratch. In the widget setting dialog make some change (no matter what as long as you get the save option enabled in the main WAB app). Save the app and then replace the json file in the apps configs/query/config_Query.json with the one you configured in your previous app.

LeoLadefian5
Occasional Contributor II

Thanks Robert, this will save me a lot of time.

0 Kudos
MTorres
Occasional Contributor

Could somebody be so kind as to walk me through the steps for this please? I got lost at "then replace the json file in the apps configs/query/config_Query.json with the one you configured in your previous app." Thanks in advance! Robert Scheitlin, GISP

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

M Torres,

   Hmm.. Not sure what else to add. In your new app app (i.e. [install dir]\server\apps\[app#]) you overwrite the configs/query/config_Query.json (or it could be something like config__#.json) with the similar file in the old app.

MTorres
Occasional Contributor

Thank you for helping Robert Scheitlin, GISP‌. I'm using the web app builder and not sure where I would find that directory.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

I am not sure if I can make it any simpler

[install dir]\server\apps\[app#]\configs\query\config__#.json

For example:

C:\WebAppBuilderForArcGIS\server\apps\2\configs\query\config__5.json

0 Kudos
CarmelConnolly
Regular Contributor

Hi Robert

I'm attempting to do a similar workflow to Leo - I have configured a long list of queries for one query widget, and I want to reuse the same queries in a second app... but the second app references a new Server service (the new service contains the exact same fields as the original one).

Following your workflow above doesn't work (as expected) because the .json file reference a different service name. I've tried updating the .json file with the new service name but the app doesn't update the query widget - any ideas?

Carmel 

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Carmel,

   Are you updating the json file in the apps folder or are you changing the one in the stemapp folder? You need to update the json that is specific to the app you are working on.

0 Kudos
CarmelConnolly
Regular Contributor

Hi Rob, 

Thanks for getting back to me!

I was editing the the json for new app in the apps folder.

I managed to get it working by adding a little extra to your workflow:

  1. Add the query widget to the new app like you are starting from scratch.
  2. In the widget setting dialog add 1 query similar to the one in the original app
  3. Save the app
  4. Open the config._Query.json of the new app, find the "webMapLayerId" of the query created in step 2, and take note of it
  5. Replace the json file in the apps configs/query/config_Query.json with the one you configured in your previous app.
  6. Open the replaced file and update all the "webMapLayerId" with the new one copied from step 4 and update the Service URLs if required

Now when I open the query widget in the new app, all the queries appear

Carmel

0 Kudos