Hi, great to see it's now easy to read an environment variable in a flow (provided the flow is created within a solution!) but how to update the value of the environment variable from within the flow?
I assume I will need to use the Dataverse connector's Update a Row function so I start by retrieving the environment variables UID using 'List rows' : -
This appears to work and I can reference the UID using: -
BUT when I try and reference that UID to update the environment variable record ...
... I receive the error: - "Bad Request - Error in query syntax."
Cheers
Solved! Go to Solution.
Hi @Anonymous,
You're setting the row ID of the update step to "Environment Variable Definition" ID, but should be the row ID of "Environment Variable Value". In the "GetSMSSyncInialise" list row step, use the "Expand Query" to include related environment variable values. This will give you the "Environment Variable Value" ID to update. Then iterate from the rows returned and update the value within the loop.
Hope this help!
Thank you @EricRegnier for pointing me in the right direction
In the end, instead of using an Expand query for List Rows I used the excellent FetchXML Builder tool (from XRMToolbox) to generate an XML Query that pulled out just the UID as follows: -
<fetch>
<entity name="environmentvariabledefinition" >
<filter>
<condition attribute="schemaname" operator="eq" value="hdc_SMSyncInitialise" />
</filter>
<link-entity name="environmentvariablevalue" from="environmentvariabledefinitionid" to="environmentvariabledefinitionid" >
<attribute name="environmentvariablevalueid" alias="envUID" />
</link-entity>
</entity>
</fetch>
... and the expression: -
All working 🙂
Hi @Anonymous,
You're setting the row ID of the update step to "Environment Variable Definition" ID, but should be the row ID of "Environment Variable Value". In the "GetSMSSyncInialise" list row step, use the "Expand Query" to include related environment variable values. This will give you the "Environment Variable Value" ID to update. Then iterate from the rows returned and update the value within the loop.
Hope this help!
Thank you @EricRegnier for pointing me in the right direction
In the end, instead of using an Expand query for List Rows I used the excellent FetchXML Builder tool (from XRMToolbox) to generate an XML Query that pulled out just the UID as follows: -
<fetch>
<entity name="environmentvariabledefinition" >
<filter>
<condition attribute="schemaname" operator="eq" value="hdc_SMSyncInitialise" />
</filter>
<link-entity name="environmentvariablevalue" from="environmentvariabledefinitionid" to="environmentvariabledefinitionid" >
<attribute name="environmentvariablevalueid" alias="envUID" />
</link-entity>
</entity>
</fetch>
... and the expression: -
All working 🙂
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
15 | |
10 | |
9 | |
5 | |
4 |
User | Count |
---|---|
22 | |
16 | |
14 | |
13 | |
12 |