How can i do this?

Hi,

My start AWB NO are same, I want to select the channel through this. And if there is no value match then users manually can select. 

Below example

5567*****>[Channel]="Amazon"

6788********>[Channel]="Myntra"

FMPR*****>[Channel]="Ekart"

SDLC0*****>[Channel]="Shopify"

 

0 7 133
7 REPLIES 7

switch (

  left([AWB NO], 4),

  "5567", "Amazon",

  "6788", "Myntra",

  "FMPR", "Ekart",

  "SDLC", "Shopify",

  ""

)

Thank you for reply @graham_howe 

 

Expression not work proper. can you send me more example. Without left function.

Where are you trying to use the expression, what error is it giving? I was simply providing a way to select the channel based on the prefix for AWB No. Perhaps you could provide some details about your table structure?

Hi @graham_howe 

start AWB NO is similar , I want to select the channel through this. And if there is a value match in the awb no column, then show the column channel in the form. users can select the column channel manually.

Below example

SDLR0*****>[Channel]="SNAPDEAL"
2777********>[Channel]="TATA"
FMPR*****>[Channel]="FLIPKART"
231651*****>[Channel]="FYND"
5546*********>[Channel]="AMAZON"
624568*****>[Channel]="Shopify"

 

Capture.PNG

OK try this.

1. Set up a table called Channel which has three text columns:

[Channel_Id] containing a unique identifier as a key.

[Description] containing the name of the channel set as label.

[Prefix] containing the AWB prefix for that channel.

graham_howe_0-1647867405212.png

graham_howe_1-1647867638108.png

Then in your main table (I called it Test) you should have the following fields:

[ID] again a unique identifier set as key, this is good practice.

[AWB No] a text field where the user will enter the AWB No.

[Channel_ID] an Enum field with reference to the Channel table.

graham_howe_2-1647867691438.png

The [Channel_Id] field in the main table should have the following configuration:

Type: Enum
Base Type: Ref
Referenced table name: Channel
Input mode: Buttons
Suggested values: Channel[Channel_Id]
Initial value: the following expression

any(
  select(
    Channel[Channel_Id], 
    startswith([_THISROW].[AWB NO], [Prefix])
  )
)

If this is set up, then the default button will be selected based upon the value entered by the user in the [AWB No] field. The user can still select an alternative Channel manually.

 

Namaste @graham_howe 

Expressions are work. But when I am entering the wrong code in the [AWB NO] column, then the channel column is not visible.

If you enter an AWB No which doesn't match any prefix then no channel is selected automatically, but the user is still able to select a channel. If they do not select any channel then the column will of course be blank, but you could certainly make it a required field if you want to force them to select a channel.

Top Labels in this Space