cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Update CDS / entity using form in PowerApps which is connected to PowerBI

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

 

2020-03-23_16-23-30.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

HI @evalindag :

Can you tell me:

  • What is the forms Default Mode?Edit?Or View?
  • What are the fields‘(CustomerStatusdatatype? text? or ?
  • What are the datacards(Customer_DataCard3,Status_DataCard3) Update properties?

Firstly, Let me Explain why you cant 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 buttons 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

View solution in original post

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

 

View solution in original post

4 REPLIES 4
Community Support
Community Support

HI @evalindag :

Can you tell me:

  • What is the forms Default Mode?Edit?Or View?
  • What are the fields‘(CustomerStatusdatatype? text? or ?
  • What are the datacards(Customer_DataCard3,Status_DataCard3) Update properties?

Firstly, Let me Explain why you cant 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 buttons 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

View solution in original post

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

 

View solution in original post

Ah I understand.

Thank you again so very much for your help, it's greatly appreciated! 😊

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (46,687)