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

Expected action not getting when Patching only if the record not existing in SharePoint List

Hi Team,

 

I'm having a collection called CalenderDB (primary key is TPoint), which I'm transferring to a SharePoint called BookingResponces (primary key is Title).

 

After looking at many solved problems in this site, I created a button OnSelect formula which is now giving me a problem with no proper results. Warnings shown are "Incompatible type. We can't evaluate your formula because the values begin compare in the formula aren't the same type".

 

ForAll(
       CalenderDB,
       If(IsEmpty(Filter(BookingResponces,Title=CalenderDB[@TPoint])),
          Patch(
              BookingResponces,Defaults(BookingResponces),
              {Title=CalenderDB[@TPoint], N101=CalenderDB[@N101],N102=CalenderDB[@N102]})
       )
)

 

 

Appreciate your kind support on this to me. Cannot figure out why this is coming as I believe the logic is okay.

 

Thanks

Dhanushka

 

2 REPLIES 2
GarethPrisk
Super User II
Super User II

What language is your Studio running as? There may be different syntax requirements, but the immediate issue I see is that you need to map destination fields using a colon.

ForAll(
       CalenderDB,
       If(IsEmpty(Filter(BookingResponces,Title=CalenderDB[@TPoint])),
          Patch(
              BookingResponces,Defaults(BookingResponces),
              {Title: CalenderDB[@TPoint], N101: CalenderDB[@N101],N102: CalenderDB[@N102]})
       )
)

Hi @GarethPrisk ,

 

Thank you so much and extremely sorry for my delay.

 

Yes, I have put in the syntax as (I mistakenly put in "=" instead of ":" when I was writing the problem. Sorry).

ForAll(
       CalenderDB,
       If(IsEmpty(Filter(BookingResponces,Title=CalenderDB[@TPoint])),
          Patch(
              BookingResponces,Defaults(BookingResponces),
              {Title: CalenderDB[@TPoint], N101: CalenderDB[@N101],N102: CalenderDB[@N102]})
       )
)

 

My Problem is can there be a problem in comparing/evaluating "Title" which is the column name of my SharePoint list with the CalenderDB[@TPoint] which is giving a array values (TPoint is the primery key column of CalenderDB collection). Is "ForAll" correct function to use?

 

Appreciate your kind attention.

 

Thanks

Tharindu

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (48,127)