count app items

Comments

11 comments

  • Jan Richter

    The thing I'm trying is to get workspace or app data to be involved in calculations. This must be possible some how.

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    Hi Jan, yes, that's possible. What exactly is your use case?

    0
    Comment actions Permalink
  • Jan Richter

    Hello Rainer, an example:

    App "invoices" has:
    3 invoices with status "abo" (each item has a number 15-01, 15-02, 15-03)
    3 invoices with status "job" (each item has a number /01, /02, /03)

    A new number should be added after/while adding a new item:

    invoice 4 with status "job" = /04

    I tried to work with item IDs. Works... as far as no item gets deleted.

    0
    Comment actions Permalink
  • Jan Richter

    Hej Rainer, what do you say? Is that possible?

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    Hi Jan,

    sorry, have forgotten to answer.

    Auto-incrementing numbers are a real problem. See here https://help.podio.com/hc/communities/public/questions/203556128-Auto-incrementing-unique-number-ranges-per-customer?locale=en-us

    And I'm not sure if I understand your use case right. How can you create the same number for "job" (/03) and "abo" (15-03) using item ID which is unique for each item? Can the status of an invoice change?

    One possible solution:
    In invoices create a relation field "Former invoices" with relation to the App Invoices itself ,
    a calculation field "xxx"

    //@invoice title
    "invoice"
    

    (You need this for a later search in GF.)

    and a calculation field "number" with

    var statusFormer = @all of status; // outgoing relation
    var statusThis = @status
    
    var sameStat = [];
    for(var i = 0; i < statusFormer.length;i++){
    if(statusFormer[i] == status){
    sameStat.push (statusFormer[i]);
    }
    };
    var number = ("00"+ (sameStat.length +1)).substr(-2) // calculates the quantity of related items and sets the leading 0
    var showJob =  "/" + number;
    var showAbo = "15-" + number;
    statusThis == "Job" ? showJob : showAbo
    

    Create a GF-flow: When item created, search for items in app invoices where field XXX equal to value field XXX of this item (ignore itself), update "Former invoices" value Ref(Invoices). All former invoices will be related to the current item. The field "Number" counts how many former items with the same status as the current item are related (sameStat.length +1 = the number of this item). You will always have the exact number, cause if one item is deleted the number changes. BUt take care: Cause numbers change it's not a unique number.

    Rainer

    0
    Comment actions Permalink
  • Jan Richter

    Hej Rainer, you understood it right and this makes total sense BUT, there will be about 500 invoices added to the latest item. Or is there a difference between being related and added to a relation field?

    Search for items stops at 99, so this also wont work.

    I thought about, asking for the latest added invoice with status "Job". That way, I could just get the latest number and add one. Would that work?

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    Yes, 99 is limit for normal GF-Accounts, 299 for Business Accounts (I think Diamond Plan and higher).
    You should create a temporary field in Invoices = date created on (if you have no other date field) and do several search runs filtered by date ranges.

    I thought about, asking for the latest added invoice with status "Job". That way, I could just get the latest number and add one. Would that work?

    Could be, just try it.

    0
    Comment actions Permalink
  • Jan Richter

    Ok, I'll check it out.

    0
    Comment actions Permalink
  • Jan Richter

    Hej Rainer, date created on was not working. I found a workaround that is very easy to use. It's not that smart but it works even with very complex systems. Here we go:

    add workspace "system"
    add app "system"
    add item "system"

    Every item created in every workspace, that needs auto-incrementing numbers will automatically be added there. That's the easiest way to get it done. Another app will then be able to make reports and other super cool stuff, that was possible only via reports.

    In the future one can only hope, that Podio will release something like "hide field".

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    Yes, that's another way. I choose this way with additional apps and specific items for collecting and building auto-incrementing numbers for most use cases. But also the ne I've described. It really depends on your individual setup and needs.

    0
    Comment actions Permalink
  • Jan Richter

    Jap, makes sense. Is there a max number of item you can add to another item via connection field? Didn't find anything in the help.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk