cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

manitpulate tabel

 
Hello
I'm trying to transfer data from one table to another

how i do this is as follows

i use this

Patch (lending beamer; Defaults (lending beamer); {product: product_beamer}; {'nmbs code': nmbcode_beamer}; {brand: brand_beamer}; {size: size_beamer})

this is to transfer the data from beamer to loaned beamer
the remove works
:
Remove (beamer;
First (Filter (beamer; DataCardKey_nmbcode_beamer = DataCardValue_nmbcode_beamer)))

when i patch i get this error
: The patch function has some invalid arguments

screen shot below for clarification


 
this is my code on the button that activates it

Knipsel.PNG

this is the table beamer


Knipsel.PNG
 
this is the table loan projector
here the data from beamer should come with the pacth function


Knipsel.PNG

 
this is the document where the tables are located


Knipsel.PNG


13 REPLIES 13
Super User III
Super User III

@ruben-dw ,

Firstly, I would suggest you separate your Patch code onto a button to get it working before putting it back at the end of the email.

However your problem is that you are not telling the Patch where to get the fields from (Beamer table) and then you need to tell it which record in the table to copy the values from.

like this

:

Patch (beamer; Defaults (lending beamer); {product: product_beamer}; {'nmbs code': nmbcode_beamer}; {brand: brand_beamer}; {size: size_beamer})

 

@ruben-dw ,

For new records - yes. I was not sure from your post whether you were doing this or updating existing records.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

i don this :

Patch( beamer; Defaults( uitleenbeamer); {product: product_beamer}; {'nmbs code': nmbscode_beamer}; {merk:merk_beamer}; {groote: groote_beamer})

 

but it still gives an errot it says : the patch function has some invalid arguments

and beamer is tabel that exists and uitleenbeamer is a table that also exists  i just want to put data into uitleenbeamer .

 

this gets its data from a textbox

{product: product_beamer}

 



@WarrenBelz 

 

i found the problem the patch dos work whit string

 

but i pas variables whit it like this

 

 

Set(product_beamer;ThisItem.'product ');;Set(nmbscode_beamer;ThisItem.'nmbs code');;Set(merk_beamer;ThisItem.merk);;Set(groote_beamer;ThisItem.groote)

 

 

 

 

this is where i give it 

Knipsel.PNG

 

so how can i fix this that this is a string

@ruben-dw ,

I did not read your Patch code properly. The defaults are where you are patching and you need to loop through the other list.

The one below patches new records to the List beamer for all records in the Collection uitleenbeamer.

ForAll(
   uitleenbeamer;
   Patch(
      beamer; 
      Defaults(beamer); 
      {
         product: product_beamer;
         'nmbs code': nmbscode_beamer;
         merk:merk_beamer;
         groote: groote_beamer;
      }
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz 

look at the picture above

i give the value into a var the i use this var to patch it into my table

it works whit string but not whit var wy is that and how can i fix this ?

@ruben-dw ,

There is no picture on your post - did you try the code I sent?

@WarrenBelz 

 

yes but it give a error

the error is when i put the var i set them like this :

Set(product_beamer;ThisItem.'product ');;Set(nmbscode_beamer;ThisItem.'nmbs code');;Set(merk_beamer;ThisItem.merk);;Set(groote_beamer;ThisItem.groote)

 

then, in my patch i put this :

Patch( beamer; Defaults( uitleenbeamer); {product: product_beamer}; {'nmbs code': nmbscode_beamer}; {merk:merk_beamer}; {groote: groote_beamer})

 

 

but the problems are :product_beamer,nmbscode_beamer,merk_beamer,groote_beamer

 

if i do this

Patch( beamer; Defaults( uitleenbeamer); {product: "string"}; {'nmbs code': "string"}; {merk:"string"}; {groote: "string"})

 

then it works

 

so what is the problem here ?

 

 

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 (45,057)