cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
medBrahmi
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
Super User

Re: invalid argument type

Is  your sharepoint list column DateFinish type Date and Time?

medBrahmi
Frequent Visitor

Re: invalid argument type

sorry for the delay 

yes the type is date and time

Community Support
Community Support

Re: invalid argument type

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.
medBrahmi
Frequent Visitor

Re: invalid argument type

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

medBrahmi
Frequent Visitor

Re: invalid argument type

And here's the snippetframe.png

Community Support
Community Support

Re: invalid argument type

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.
medBrahmi
Frequent Visitor

Re: invalid argument type

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.

 

 

medBrahmi
Frequent Visitor

Re: invalid argument type

frame2.png

Community Support
Community Support

Re: invalid argument type

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,780)