cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate V
Advocate V

Global variable not recognised as a record

My app has two registration forms, each with their own data source - both SP lists. The first registration form is working fine and uses a global variable (varProjects) to save the data on each screen.

So on the home screen, the button which navigates to this form uses this formula:

Set(varProjects, Blank()). There is then a ClearCollect for the navigation menu component and varProjects is referenced under Status.

Status: varProjects.AboutComplete - where AboutComplete is a column in the actual data source.

The variable is referenced as Item on each form for this registation. On each save button, where the form is in edit mode, the formula is:

Patch (
ProjectRegister,
varProjects,
Form_About.Updates, {AboutComplete:true}.

 

This works absolutely fine. However, if I use another variable for my 2nd registration form with the same formulas, I get errors. So in the ClearCollect when I add: Status: varData.AboutComplete I get this error:

Incompatible type: the 'Status' column in the data source you're updating expects a boolean type and you're using a error type.

My patch on the save button has the following error:

The function 'Patch' has some invalid arguments. Invalid argument type (Boolean). Expecting a Record value instead.

It looks like varData is set to false, but I set it to Blank.

The item is set to varData. Why is it not recognising it as a record value?

1 ACCEPTED SOLUTION

Accepted Solutions
Advocate V
Advocate V

Issue resolved. I removed all reference to the variable, saved and published the app then started again. Seems to be working now.

View solution in original post

2 REPLIES 2
Advocate V
Advocate V

Anyone able to help with this please? I've checked the Variables screen for it and it's set as Boolean with value 'true' yet there is nowhere where it has been defined as this as far as I can see. I've tried removing all mention of the variable and starting again with a new name and it still sets it as a boolean.

These are the two definitions of it: 

In the gallery: 

UpdateContext({conLoading: true});
Select(Parent);
Set(varYourData, DatasetsGallery.Selected;


Navigate('Dataset About')
;
UpdateContext({conLoading: false}))

 

On the button to open the form:

et(
varFormMode,
FormMode.New
); Set(varYourData, {}; ClearCollect(NavigationMenuData,{Title:"About",Image:maindetails,Status: true,Screen:'Dataset About'},{Title:"Data types & Categories",Image:maindetails,Status:true,Screen:'Data types and categories'},{Title:"Sharing & Outsourcing",Image:maindetails,Status:true,Screen:'Data Sharing Outsourcing'}, {Title:"Risk Mitigation",Image:maindetails,Status:true,Screen:'Data Risk Mitigation'}, {Title:"Access, Storage & Location",Image:maindetails,Status:true,Screen:'Data Access storage location'}, {Title:"Linked",Image:maindetails,Status:true, Screen:'Data Linked' }, {Title:"Retention, Archiving & Deletion",Image:maindetails,Status:true,Screen:'Data Retention Archiving'});

Navigate('Dataset About'))

 

 

Advocate V
Advocate V

Issue resolved. I removed all reference to the variable, saved and published the app then started again. Seems to be working now.

View solution in original post

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 (45,091)