Hi all,
I seem to be having a problem where some values are not getting returned to Powerapps from a Flow.
The flow takes values entered in the app and sends two rows to SQL Server, and then should return two id's generated by the database to the app, along with two constant values for error handling ("success" and a message).
In the app, the response is set as a variable
The constant values are coming through fine, however, the two SQL generated id's are not coming through, even though Power Automate says that it sent the values when I check the execution history.
Any idea what might be happening?
Thanks!
Solved! Go to Solution.
Okay, I've figured out what the issue was.
For whatever reason, there was a type conversion error, where the id's were trying to be passed as strings, when it was expecting an integer.
I changed the Respond to Powerapps step to send back strings instead of numbers, and now they're coming through fine.
Thanks for the help, and hope this is of use to someone else in the future
Hi @SandAStairs ,
Would you be able to share the screenshot of Power Automate and Canvas App formula?
Ideally it should return all the values including constant values. I Hope you have added Respond to Powerapps action and mapped all values as shown below
Please mark my answer verified if this is helpful!
Regards,
Bipin Kumar
Follow my Blog: https://xrmdynamicscrm.wordpress.com/
Please mark my answer verified if this is helpful!
Regards,
Bipin Kumar
Follow my Blog: https://xrmdynamicscrm.wordpress.com/
Hi @bipinshan,
Here is the flow formula
And this is the Powerapp formula which calls it
If(
is_new_site,
Set(response_variable, SaveSite2.Run(JSON({
cust_id: data_card_cust_id.Update,
site_address: data_card_site_address.Update,
site_desc: data_card_site_desc.Update,
site_asana_id: Blank(),
site_adr_lot_no: data_card_site_adr_lot_no.Update,
unit_type_name: data_card_unit_type_name.Update,
site_adr_unit_no: data_card_site_adr_unit_no.Update,
site_adr_street_no: data_card_site_adr_street_no.Update,
site_adr_street_name: data_card_site_adr_street_name.Update,
state_name: data_card_state_name.Update,
suburb_name: data_card_suburb_name.Update,
site_group_id: data_card_site_group_id.Update,
site_created_at: data_card_site_created_at.Update,
desc_name: data_card_desc_name.Update
}))),
Set(response_variable, UpdateSite.Run(JSON({
site_id: selected_site_id,
cust_id: data_card_cust_id.Update,
site_address: data_card_site_address.Update,
site_desc: data_card_site_desc.Update,
site_asana_id: Blank(),
site_adr_lot_no: data_card_site_adr_lot_no.Update,
unit_type_name: data_card_unit_type_name.Update,
site_adr_unit_no: data_card_site_adr_unit_no.Update,
site_adr_street_no: data_card_site_adr_street_no.Update,
site_adr_street_name: data_card_site_adr_street_name.Update,
state_name: data_card_state_name.Update,
suburb_name: data_card_suburb_name.Update,
site_group_id: data_card_site_group_id.Update,
site_created_at: data_card_site_created_at.Update
}))); Refresh('quoting_system_db.site');
);
If(
response_variable.response = "error",
UpdateContext({show_error: true, error_message: response_variable.message}),
Set(selected_site_id, Text(response_variable.site_id)); Navigate(scrViewSite)
)
All of the flow endings return to Powerapps
There are two different flows that get called based on the condition "is_new_site" (which is set to true), but both return the same values.
Hope that helps!
Just to follow up with a couple more details, I ran a test with a simplified formula:
Set(response_variable,
SaveSite2.Run(
JSON(
{
cust_id: data_card_cust_id.Update,
site_address: data_card_site_address.Update,
site_desc: data_card_site_desc.Update,
site_asana_id: Blank(),
site_adr_lot_no: data_card_site_adr_lot_no.Update,
unit_type_name: data_card_unit_type_name.Update,
site_adr_unit_no: data_card_site_adr_unit_no.Update,
site_adr_street_no: data_card_site_adr_street_no.Update,
site_adr_street_name: data_card_site_adr_street_name.Update,
state_name: data_card_state_name.Update,
suburb_name: data_card_suburb_name.Update,
site_group_id: data_card_site_group_id.Update,
site_created_at: data_card_site_created_at.Update,
desc_name: data_card_desc_name.Update
}
)
)
);
Navigate(Screen1);
Here is the output in Powerapps
And the output body in Power automate
Okay, I've figured out what the issue was.
For whatever reason, there was a type conversion error, where the id's were trying to be passed as strings, when it was expecting an integer.
I changed the Respond to Powerapps step to send back strings instead of numbers, and now they're coming through fine.
Thanks for the help, and hope this is of use to someone else in the future
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 |
---|---|
184 | |
45 | |
45 | |
35 | |
34 |
User | Count |
---|---|
257 | |
82 | |
78 | |
67 | |
65 |