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

Re: invalid argument type

Is  your sharepoint list column DateFinish type Date and Time?

Highlighted
Frequent Visitor

Re: invalid argument type

sorry for the delay 

yes the type is date and time

Highlighted
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.
Highlighted
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

Highlighted
Frequent Visitor

Re: invalid argument type

And here's the snippetframe.png

Highlighted
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.
Highlighted
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.

 

 

Highlighted
Frequent Visitor

Re: invalid argument type

frame2.png

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,475)