cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lorem1960
Resolver III
Resolver III

Expected a Value Compatible with DataSource?

From my datatable named DataTable1, I want to be able to open the form FormDetails when users click on the column named PR #, on the OnSelect Action of my column I have this code:

 

Set(SelectedRecord,DataTable1.Selected.'PR #');EditForm(FormDetails);Navigate(FormDetails,ScreenTransition.None)

 

and power apps is not complaining, meaning no error message is being displayed. But when I check my FormDetails form for the Item : DataTable1.Selected here it complains with the message: Expected a Value Compatible with 'DataSource'

 

I am wondering what I am doing wrong here??

 

 

 

7 REPLIES 7
AmeerJab
Resolver I
Resolver I

Hello,

By understanding the above you want to change the value of only one column using a edit form?

 

Regards.

Basically, the FormDetails should open in Edit mode and users needs to be able to update 4 fields on that form. Strangely enough this used to work just fine. 

AmeerJab
Resolver I
Resolver I

Hello,

 

  1. Go to the form Default mode and set it as a variable ex.. "varDisplayMode"
  2. Add a button and set the OnSelect to Set(varDisplayMode,FormMode.Edit)

of-course if you want the form to return to view mode after editing you can add a button that will re-change the default mode and to save the changed values you can add a save button and put it visibility to be when the form has been changed to edit to appear.

 

Ps: for this to work you need your form to be Edit form not display form 

a bit confused here:

 

Lorem1960_0-1635246513256.png

How can I set or assign a variable here?

you can access the formula bar by either clicking on the word "Default mode" or from the dropdown in the top left.

 

  1. then in the formula bar add the variable name "varDisplayMode" ofc you can set the name to be as you want
  2. then add a button that will change your form to edit mode and set the OnSelect formula to be Set(varDisplayMode,FormMode.Edit)

 

 

ok I got point 1 now, So I suppose I need to add that button on the DataTable1 right? 

You can add the button on the screen, to be honest it doesn't have to be a button you can add the functionality on any component that has OnSelect method 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,787)