cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

invalid argument type

Im developping an app based on the 2 sharepoint lists :

 

Bookings(clientName, dateStart, DateFinish, Registration number, Destination)

Vehicules(RegistrationNumber, status, Brand)

 

i want to update the vehicules list on the start of the app based on the saturated bookings (finish date), i used the formulas :

                          UpdateIf(Cars, Bookings.DateFinish<Today(), {Status:"Disponible"}) 

but it gives me the error : invalid argument type, expecting a number value on the "DateFinish" value

anyone knows why ?

 

thank you in advance

9 REPLIES 9
Super User II
Super User II

Is  your sharepoint list column DateFinish type Date and Time?

sorry for the delay 

yes the type is date and time

Community Support
Community Support

Hi @medBrahmi,

 

Could you please share a bit more about the error message within your app?

Could you please show more details about the Cars that you mentioned within the formula?

Further, do you want to update corresponding record in Vehicules list when the DateFinish column value of each record in Bookings list is less than today' date?

 

If you want to update corresponding record in Vehicules list when the DateFinish column value of each record in Bookings list is less than today' date, I think there is something wrong with the formula that you provided.

 

I have made a test on my side, please take a try with the following formula:

ForAll(
RenameColumns(
RenameColumns(Bookings,"DateFinish","DateFinish1"),
"Registration_x0020_number",
"RegistrationNumber1"
),
UpdateIf(
Vehicules,
DateFinish1<Today()&&RegistrationNumber=RegistrationNumber1,
{
Status:"Disponible"
}
)
)

Note: The "Registration_x0020_number" represents the Registration number column in your Bookings list.

 

Or

ForAll(
Bookings,
UpdateIf(
Vehicules,
DateFinish<Today()&&RegistrationNumber=Bookings[@Registration_x0020_number],
{
Status:"Disponible"
}
)
)

Note: The RegistrationNumber represents the RegistrationNumber column in Vehicules list.

 

More details about the ForAll function in PowerApps, please check the following article:

ForAll function

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sorry i mistyped the the "cars" is meant to be the vehicules list

thank you for your answer good sir, your given formula is perfectly correct but i have a an invalid argument error but this time in the equal sign in the join operation

 

best regards 

 

medBrahmi

And here's the snippetframe.png

Hi @medBrahmi,

 

Which type the RegistrationNumber column in your Vehicules list ? Is it a Number type column?

 

Please take a try with the following formula:

ForAll(
  RenameColumns(
         RenameColumns(Bookings,"DateFinish","DateFinish1"),
         "Registration_x0020_number",
         "RegistrationNumber1"
    ),
  UpdateIf(
    Vehicules,
    DateFinish1<Today()&&RegistrationNumber=Value(RegistrationNumber1),
    {
     Status:"Disponible"
    }
 )
)

then check if above formula would solve your problem.

 

Note: I assume that the type of the RegistrationNumber column in your Vehicules list is a Number type column.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you for the quick response

Yes it is indeed a number type column and i already tried adding value to RegistrationNumber1 but no luck.

 

 

frame2.png

Hi @medBrahmi,

 

Could you please share a bit more about the error message within your formula?

Further, could you please show more details about the data structure of the Cars list?

 

Please check if there is a RegistrationNumber column (a Number type column) existed in your Cars list. 

 

In addition, please also check if you have modified the RegistrationNumber column name (or change original column name into RegistrationNumber) within your Cars list. If you have modified the column name, please consider take a try to re-create your Cars list, then try the above formula I provided again to check if the issue is solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (49,871)