Hi there,
I am building an app which is connected to Power BI using the PowerApps visualization in Power BI
The app includes a form in which the fields from the entities are presented
I want to be able to change two of the fields (Customer and Status) by using a dropdown. The dropdowns are connected to other entities (customer is one entity containing all possible customers and status includes an entity containing five statuses which are available)
The gallery on the right is supposed to update but it doesn't work
I have tried using SubmitForm, PATCH, COLLECT on the button but haven't been able to get it working
Does anybody know how this can be achieved?
Best regards
Solved! Go to Solution.
HI @evalindag :
Can you tell me:
Firstly, Let me Explain why you can’t update the data.
About functions:
SubmitForm: Judging from your picture ,the form control seems like in ViewForm mode. The SubmitForm and ResetForm functions have no effect when in this mode.
Collect: The Collect function adds records to a data source. It can not modify records.
About the code:
The value of Dropdown1.SelectedText is a record, I think you might want to use Dropdown1.SelectedText.Value here.
Secondly, since I know very little about the form in your case, I suggest you use patch function here:
Set the button’s onselect property to:
Patch(collTaskListForGallery,Gallery1.Selected,{Customer:Dropdown1.SelectedText.Value ,Status:Dropdown2.SelectedText.Value}) /* Gallery1.Selected is the record which you want to modify(you can use the code that in the form’s items property here) */
Best Regards,
Bof
Hi @evalindag :
Yes,the value in Update property is the value want you want to update.But it doesn't matter if you use patch to modify the records.
You can also modify the records by modifying the Update property in combination with the submitform function.
Set Customer_DataCard3's update property to:
Dropdown1.SelectedText.Value
Set Status_DataCard3 update property to:
Dropdown2.SelectedText.Value
add a button and set it's onselect property to:
SubmitForm(Form1)
Best Regards,
Bof
HI @evalindag :
Can you tell me:
Firstly, Let me Explain why you can’t update the data.
About functions:
SubmitForm: Judging from your picture ,the form control seems like in ViewForm mode. The SubmitForm and ResetForm functions have no effect when in this mode.
Collect: The Collect function adds records to a data source. It can not modify records.
About the code:
The value of Dropdown1.SelectedText is a record, I think you might want to use Dropdown1.SelectedText.Value here.
Secondly, since I know very little about the form in your case, I suggest you use patch function here:
Set the button’s onselect property to:
Patch(collTaskListForGallery,Gallery1.Selected,{Customer:Dropdown1.SelectedText.Value ,Status:Dropdown2.SelectedText.Value}) /* Gallery1.Selected is the record which you want to modify(you can use the code that in the form’s items property here) */
Best Regards,
Bof
Hi @v-bofeng-msft and thank you for your reply!
The form's default mode is Edit
Customer field is Text and Status is a multiline text
The update property is empty for both datacards
I tried using the formula you sent, it doesn't bring an error however when I go to preview mode it just says "No item to display" but the app works when integrated with PowerBI - It does what it is supposed to do!
Thank you so much! 😊 But are the datacards supposed to have a update property?
Hi @evalindag :
Yes,the value in Update property is the value want you want to update.But it doesn't matter if you use patch to modify the records.
You can also modify the records by modifying the Update property in combination with the submitform function.
Set Customer_DataCard3's update property to:
Dropdown1.SelectedText.Value
Set Status_DataCard3 update property to:
Dropdown2.SelectedText.Value
add a button and set it's onselect property to:
SubmitForm(Form1)
Best Regards,
Bof
Ah I understand.
Thank you again so very much for your help, it's greatly appreciated! 😊
User | Count |
---|---|
196 | |
124 | |
87 | |
49 | |
42 |
User | Count |
---|---|
284 | |
163 | |
138 | |
75 | |
72 |