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

Link in DataTable stops working after modifying with AddColumns()

I've got a DataTable with one cloumn HyperLink enabled.

When the user clicks on the HyperLink, it brings them to another screen where they can modify the record as per the DataTable. 

 

donalmcnamee_0-1631866635047.png

 

 

This all works fine. However, when I AddColumns() to the DataTable and then click the HyperLink, the modify screen gives an error:

 

Invalid Formula: Expected a value compatiable with 'DataSource'

   

donalmcnamee_1-1631866799485.png

 

donalmcnamee_2-1631866925799.png

 

What's going on with AddColumns() that's causing this error?

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @donalmcnamee ,

That is because the added column is not available for the form - you need

Filter(
   DataSource,
   ID=PartsTable.Selected.ID
)

 

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 

So I've changed Item on the Form to now read:

Filter('public.parts', ID=PartsTable.Selected.ID) 

 But it's complaining about Incompatiable types for comparison

donalmcnamee_0-1631869504483.png

 

Is there something else I'm missing?

@donalmcnamee ,

Very strange - I am assuming 'public parts' is a SharePoint list, therefore will have a numeric ID and PartsTable is a Gallery based on the same list - is this not correct?

@WarrenBelz 

'public.parts' is a PostgreSQL table that I'm accessing via a Gateway. 

The ID on the table is 'id' (note that it's lower-case).

 

(Following is a screen-shot of the table structure for 'public.parts' in PostgreSQL)

donalmcnamee_0-1631879213638.png

 

I though it may have sometihng to do with case (ID vs id) but it dosen't seem to make a difference. 

Just to confirm, PartsTable is a Data Table based on 'public.parts' and not a Gallery

 

donalmcnamee_1-1631879596070.png

 

@WarrenBelz 

I got this working, but I'm not sure it's the most elegant solution. 

 

In OnSelect in my DataTable I have: 

 

Navigate(
	Form2,ScreenTransition.Cover,{
		selectedId:Value(PartsTable.Selected.id)
	}
)

 

In in my form for Item I have:

 

LookUp('public.parts', id=Value(selectedId))

 

 

@donalmcnamee ,

Pretty much the structure I posted except you did not tell me your data source was SQL - I was assuming SharePoint as you used ID.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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