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

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

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]})
       )
)
Highlighted
Frequent Visitor

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

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

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

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

Top Solution Authors
Top Kudoed Authors
Users online (5,084)