Multiple ID Returns and Incorrect Source Attribution in Linked App

TL;DR
I have a field with multiple related apps. All apps contain an ID. I am pulling over the ID from the linked item even if I’m not calling from that app.


I have a production app
multiple “product apps” are linked through a related app.
prod1, prod2, prod3, …

I have set it up to pull over the ID from all linked products so we can keep things together.

Only one product is ever linked as this is the “production ticket” for the item.

In the above image, I noticed that the “ID” is being returned multiple times.

If I comment out all the “@all of estimate ID” for everything except for one, then the ID is only returned one time.

In the screenshot above, I commented out everything except for “stickers”. The odd thing is that there is not an item from “stickers” attached here, only “substrates” yet somehow it is pulling the correct ID from “substrates” over. Is it because they have the same field name (eg Estimate ID)?

I do not feel like this is how it should work but I may be mistaken.
I am looking for any clarification on this and a suggested best practice.
Should I only call one app even though I need data from multiple apps??


1 Like

Also, I triple checked to make sure I was not calling the same @all of multiple times.

  • I also tried with nulls
  • I also tried: @all of + @all of

Hi @1F2Ns

Although I am unsure as to why your way puts the same ID multiple times (it does when I use your method as well), this way seems to work:

let id = "";
if (@All of Unique ID[0]) {
id = @All of Unique ID[0]; //base one
	}
if (@All of Unique ID[0]) {
id = @All of Unique ID[0]; //base two
	}
if (@All of Unique ID[0]) {
id = @All of Unique ID[0]; //base three

	}
id;

All the best

2 Likes

Thanks Jason.
I agree, an if/else statement is a great solution for this.

My question still stands in regards to how/why unrelated apps are pulling data from fields in different apps.

Hopefully we can gain some insight and best practices from the team.

2 Likes

Hi @1F2Ns,

thank you very much for your report and your detailed analysis. You are helping us a lot with this!
We will analyze the issue and get back to you here.

Cheers
Leo

1 Like

So, I am now running into an issue where I am having ‘ghost’ data showing up.
For example, I have a “Banner” attached and that is all, I will have a ‘ghost’ or ‘shell’ of “web design” that shows up regardless.

I have tried the following;

  • deleted all items in the app itself
  • changed the name so it is unique
  • switched to a number calc instead of a text calc
  • Deleted the incoming field and recreated it (that worked for a short while)

Things I have noted along the way

  • Commenting out the @all of field allowed me to find out where it was coming from.
  • It looks to be a caching issue or something of the sorts.
  • It is new and only happens with two of my apps so far (installations and web design)
  • “Installations” and “Web Design” were both cloned from a different line item app within the last week
  • “Graphic Design” was built after “Installs” but before “Web”.
  • “Graphic Design” was was not cloned and that does not causes an issue at the time of writing

Screenshot of the HTML ‘ghost’ that is showing up even if all items in the app are deleted.

I did create a workaround to remove all of the ‘ghost’ items until we learn more about this issue. I am sharing it below so it can help someone else should they run into this issue as well.

var allItems = "";

var productArrays = [
 @All of related field, //Add your @all of fields here
 @All of another related field, //Separate each with a comma
];

productArrays.forEach(lineItemPreviews => {
  lineItemPreviews.forEach(lineItemPreview => {
    if (lineItemPreview && !lineItemPreview.includes('null')) {
      allItems += `${lineItemPreview}`; // Add line item preview to allItems if it's not null and doesn't contain 'null'
    }
  });
});

html;
1 Like