Community

Concatenate repeating group fields Answered

Hi.

I added my first repeating group in a FlexiLayout, and I am recognising some fields which can be repeated N times one below each other.

Now I need a block which concatenates these fields with a separator like , (comma) or | (pipe).

I tried to add a new Repeating Block with a Text Block but it is not what I need because I need all instances combined in a single database field during the extraction.

Could you help me please?

Thank you very much!

Bye

Was this article helpful?

0 out of 0 found this helpful

Comments

2 comments

  • Avatar
    Permanently deleted user

    Hi decibel,

    You can only do it on FlexiCapture level. Here is a short instruction how:

    • Make a repeating group.
    • Make a text field in FlexiCapture (Project Setup Station) outside of Repeating group. You don't need a block for this.

    In properties of just created field do the following:

    • Set recognition to "Do not recognize".
    • Uncheck "Should be matched", "Can have region" and check "Export field value" checkmarks in General tab.
    • Uncheck "Requires verification" checkmark in Verification tab.
    • Make a rule with a code similar to this (rule should have "TotalTotal" as non-readonly and "Total" as read-only):

    for (int i=0;i<Context.Field("Total").Items.Count;i++)
    {
    Context.Field("TotalTotal").Text+=Context.Field("Total").Items[i].Text+@"|";
    }
    Context.Field("TotalTotal").Text=Context.Field("TotalTotal").Text.TrimEnd('|');

    Where "TotalTotal" is your summary field.

    Please feel free to ask questions if you struggle or need any details while implementing this feature.

    Best regards,

    Vladislav

    0
  • Avatar
    Permanently deleted user

    Thanks!

    I realized that FlexiCapture supports a "Merge Fields" rule which does exacly what I want!

    0

Please sign in to leave a comment.