Issues with Filtering and Linking Texting Records to the Correct Job ID for Messaging Integration

My wits have been fried spending countless hours on a solution but can’t seem to get it to work so any help I would be so grateful!

I am experiencing persistent issues in setting up an effective filtering system in AppSheet to correctly link Texting records to the proper Job ID in my app. My goal is to ensure seamless messaging integration, where each Texting record is accurately associated with its respective Job based on a Composite Key (e.g., combining Job ID and Client ID). However, I am encountering two main problems:

  1. Filtering All Rows or None at All:

• Attempts to filter records by Composite Key or Job ID often result in either all rows from the Texting table being returned or none at all, without a clear middle ground that accurately reflects the desired rows. I have tried various filter conditions and slice setups, including direct comparisons, LOOKUP functions, SELECT statements, and ANY functions, but have not achieved the expected results.

  1. Dashboard Context and Row Context Challenges:

• When using these filters within a dashboard context, the row context does not seem to be passed reliably between views. I suspect this may be related to limitations in how AppSheet handles virtual columns and context in a dashboard setup, but despite adjusting conditions to account for this, I have not found a stable solution.

• I have also experimented with making Job ID a Ref to the Jobs table and using direct Job ID matches, but the filter conditions either overfilter or underfilter, failing to show only the intended Texting records related to the currently selected Job.

Current Setup:

• Texting Table: Includes Job ID, Composite Key (Physical) (a concatenation of Job ID and Client ID), and Message ID (primary key for each message).

• Jobs Table: Contains Job ID, Client ID, and a corresponding Composite Key (concatenating Job ID and Client ID).

Objective:

I need guidance on setting up a filter condition or a reliable structure that:

• Filters Texting records to display only those that correspond to the Composite Key and Job ID of the selected job, ideally within a dashboard context.

• Avoids showing unrelated Texting records for other Job IDs or Composite Keys.

Any insights into best practices or AppSheet-specific limitations with filtering and dashboard context would be greatly appreciated, as I’ve encountered consistent challenges with this setup.

I currently am testing two different slices with no luck.

Slice 1 (Interface) - ISNOTBLANK(
SELECT(
Texting[Message ID],
[Composite Key] = [_THISROW].[Composite Key]
)
)

Slice 2 (Composite) - AND(
[Job ID] = LOOKUP([_THISROW].[Job ID], “Jobs”, “Job ID”, “Job ID”),
[Composite Key (Physical)] = LOOKUP([_THISROW].[Job ID], “Jobs”, “Job ID”, “Composite Key”)
)

See attached pics for additional setups. Generally when using a dashboard board view “[Composite Key] = [_THISROW].[Job ID]” usually pulls the appropriate data through the proper view. Just the “texting” view wont work right.

What does “composite” mean in your app?

It is a combination of Job ID & Client ID so that the client ID can remain a constant across the app.

Can you explain this in more detail? I don’t understand why you would want this composite key when you already have both Job ID and Client ID as separate values.

When using these filters within a dashboard context, […]

Ooooh! Are you using the built-in filtering feature in the search bar? Yeah, you aren’t going to be able to get the dashboard to work the way I think you want. To get that, you’ll need to implement your own filter using slices.

The Job ID is unique to each job, and the Client ID is also exclusive to each job. I use a Composite ID that combines the Job ID and Client ID, which links a client to a specific job. This setup allows me to create multiple jobs for any client without causing duplicate data or errors. To my knowledge, I’m not using the built-in filter feature in the search bar; it’s primarily for looking up clients. Each view in my app has its own individual slice, tailored to the specific purpose of that view. I hope this clarifies things.

How does this work? Is this column used as a key column in a table?

All tabs on dashboard work correctly across the app. Just the Texting tab will not pull the unique data through that is connected to the composite key of the job. The rows on texting table are unique by the “Message ID” which is the key row. I have a “client lookup” virtual column that Identifies the client through the number which pulls the “Client ID” through. Then i have a “Related Job ID” Virtual Column that will pull through the newest Job ID that matches the Client ID for the specific client.

Are you using an interactive dashboard?

Not in interactive mode.

1 Like

Im currently using a Slice for Texting Table call “Composite” using row filter - AND(
[Job ID] = LOOKUP([_THISROW].[Job ID], “Jobs”, “Job ID”, “Job ID”),
[Composite Key (Physical)] = LOOKUP([_THISROW].[Job ID], “Jobs”, “Job ID”, “Composite Key”)
)

Composite Key (Physical) - Is the Composite Key that has a column on the Table. I have another column “Composite Key” they both relay the same information. I created the physical to see if there was an issue with virtual column Composite Key. There isnt any apparent issue regardless if i use the Composite key physical or the composite key as REF to the Jobs table. It still returns the same data

I recommend changing the column types of the Client ID and Job ID column in the Texting table to Ref:

In the Client ID column, set Referenced Table to your clients table; in the Job ID column, set Referenced Table to your jobs table. You’ll then need to populate those columns of the Texting table with appropriate values from the respective tables’ key columns.

So the client id uses formula - [Client ID Lookup] the Client ID Lookup is a virtual column that uses this formula. LOOKUP(
RIGHT([_THISROW].[Standardized Phone], 10),
“Contacts”,
“Standardized Phone”,
“Client ID”
)

Which Gives me the correct Client ID to Compute in the Client ID.

Job ID uses formula [Related Job ID] - Related Job ID uses formula ANY(
SELECT(
Jobs[Job ID],
[Client ID] = [_THISROW].[Client ID Lookup]
)
) This calculation allows me to generate the Composite Key which is a virtual column that used the formula CONCATENATE([Related Job ID], “-”, [Client ID Lookup])

So im using the composite key as a REF which should work or atleast I thought.

I’m finding your structure very confusing–it does not align to common practice. I’m afraid I’m not prepared to spend any more time trying to understand it.

1 Like