InfoPath attachment in a repeating table - list

First of all, Thank You. Here is my Boondoggle...
Currently, users are required to do regular training which is printed
and stored in user's manila folder.
My objective:
Create a SharePoint List page with InfoPath forms for each training item.
Included in this form:
Training Title/Description/Due date
User Name - Repeating table pulled from a data connection to a SharePoint list with "User Names".
(60 users max, this list also has title, name, phone number)
A PDF attachment for their certificate of completion.
EXAMPLE:
Blow your nose today.
Due Date 08-23-2013
Name Attachment
Joe Smith XZX.PDF
Bill Smith YYY.PDF
Jack Smith ZXZ.PDF
I am able to create the repeating table list of names from the 'user names' List.
But, I cannot figure out a way to attach a file to each name individually.
I add a file and it populates the entire list.
Joe Smith AAA.PDF
Bill Smith AAA.PDF
Jack Smith AAA.PDF
Any ideas would be greatly appreciated, Thank you in advance!

Related

how to create dependent dropdown list in CRUD Django

I am a beginner and trying to create CRUD Django Application where I want to keep the below fields.
Company Name
DOB
Date and time
State (should be dependency between State and City)
City (should be dependency between State and City)
Please help me for complete code
For example i give input as:
company name : ABC
DOB Date and time : 2022-01-01 08:12:00
State : Karnataka(if I select State "Karnataka" then related city of Karnataka has to be showed in dropdown)
City : Bangalore, Mysore
if I click on edit button entire field's value has to be show
form design has to horizontal (for Example)
company name DOB , Date and time
State , City
Not like this (for Example)
company name DOB
Date and time
State
City
I created CRUD mini project with Dependent Dropdown
Repo link here
Browser Output

How can I model this data in DynamoDB for a Library App

I have two entities, Books and Authors with a strict one-to-many relationship (many-to-many relationship not required for my use case)
The access patterns I want to satisfy are:
Get Author Info by Author Name
Get Book Info By just ISBN
Get all Books records by an Author using Author Name.
Do I need any GSI given the constraint that I can make only a single request to DB when adding a Book or an Author, and fulfill above three access patterns also with a single request?
If my Author Entity uses this key schema:
Partition Key: AUTHOR#XYZ
Sort Key: AUTHOR#XYZ
and for Book Entity I use
Partition Key: BOOK#123
Sort Key BOOK#123
I can get author info by name and book info by ISBN easily. How do I get the 3rd access pattern, entire book data by author name?
Two approaches I thought of:
Have a third entity in the table with PK AUTHOR#XYZ, SK BOOK#123, and use BEGINS_WITH(SK, 'BOOK') but in this approach, when adding a book to DB, I will have to write two items, PK BOOK#, SK BOOK# for getting book by just ISBN and PK AUTHOR#, SK BOOK# for getting all books by author, and the book info will be duplicated in both items.
Add an attribute GSIAuthorName to Book entity when adding a book, and create a GSI with PK GSIAuthorName (AUTHOR#XYZ) and SK being PK of Book entity (BOOK#123). But in this the issue is, in projections I will have to select ALL, since I want all book info attributes by author name, and need to fetch in single query to the GSI, so entire Book Entity will be duplicated in this GSI.
Is there an easier way to model this data?
Since you're trying to have two different access patterns for a single entity that require a different partition key value, there is basically only the two options you have identified correctly.
Your design seems to only work for books that have a single author. In the real world that's not sufficient. There are plenty of books with multiple authors such as "The Dictator's handbook" by Bruce Bueno de Mesquita and Alastair Smith - your data model might want to account for that. Author <-> Book isn't One-to-Many, it's Many-to-Many.
I'd go for something like this which uses a Global Secondary Index. It's very close to your second suggestion.
PK
SK
GSI1PK
GSI1SK
type
attributes
AUTHOR#ALASTAIR SMITH
AUTHOR#ALASTAIR SMITH
author
name, birthdate, ...
AUTHOR#BRUCE BUENO DE MESQUITA
AUTHOR#BRUCE BUENO DE MESQUITA
author
name, birthdate, ...
BOOK#978-1610391849
AUTHOR#ALASTAIR SMITH
AUTHOR#ALASTAIR SMITH
BOOK#978-1610391849
book
title, publisher, author,...
BOOK#978-1610391849
AUTHOR#BRUCE BUENO DE MESQUITA
AUTHOR#BRUCE BUENO DE MESQUITA
BOOK#978-1610391849
book
title, publisher, author,...
Does this introduce data duplication? - Yes
Does this introduce complexity on writes? - Yes
Does it work in the real world? - Yes
The model I've chose allows you to fulfill the requirements:
Get Author Info by Author Name: GetItem on the primary index with PK=AUTHOR#... and SK=Author#...
Get Book Info by just ISBN: Query on primary index with PK=BOOK#... and limit 1
Get all books for an Author: Query on GSI1 with PK=AUTHOR#
When you write a book, you need to add a book record for each author and potentially the author entries. For updates on a books info (which should be very rare) you first do the query as in 2) without the limit and then update each item that comes back.
Update
To address the requests for clarification in the comments:
If you require a strict One-to-Many relationship, I'd pick the second approach
Frequent writes are typically not a problem in your one-to-many case as long as you don't exceed the write throughput of a single partition, which is unlikely given the data. I don't see why you'd need frequent writes though.
The extra complexity is typically only a one-time penalty when you create your data access layer. The code for update_book_by_isbn will have to include the steps I outlined above and the create_book might store multiple records.

Formula Won't Stop Skipping Lines When Writing Data

I'm currently working on a project using Google form to gather data into an excel sheet, and then organize the data based on answers of the form. After an employee selects a department and submits a form, I would like to filter each response by department to its own page within the workbook.
I've listed my current formula below. As of now, it will only import the data on the same row when it is sorted into a new page, thus leaving many blank spaces in between information. Is there a way to make sure it will not skip rows during the import?
=IF(REGEXMATCH('Form Responses 1'!D2:D1101, "Department Name"), 'Form Responses 1'!B2:B1101," ")
try:
=FILTER('Form Responses 1'!B2:B1101,
REGEXMATCH('Form Responses 1'!D2:D1101, "Department Name"))

Django query: get the last entries of all distinct values by list

I am trying to make a Django query for getting a list of the last entries for each distinct values from a MySQL database. I will show an example below as this explanation can be very complicated. Getting the distinct values by themselves obviously in Django is no problem using .values(). I was thinking to create couple of Django queries but that looks to be cumbersome. Is there an easy way of doing this.
For the example below. Suppose I want the rows with distinct Names with their last entry(latest date).
Name email date
_________________________________________________
Dane dane#yahoo.com 2017-06-20
Kim kim#gmail.com 2017-06-10
Hong hong#gmail.com 2016-06-25
Dane dddd#gmail.com 2017-06-04
Susan Susan#gmail.com 2017-05-21
Dane kkkk#gmail.com 2017-02-01
Susan sss#gmail.com 2017-05-20
All the distinct values are Dane, kim, Hong, Susan. I also want the rows with the latest dates associated with these distinct name. The list with entries I would like is the rows below. Notice Names are all distinct, and they are associated with the latest date.
Name email date
_________________________________________________
Dane dane#yahoo.com 2017-06-20
Kim kim#gmail.com 2017-06-10
Hong hong#gmail.com 2016-06-25
Susan Susan#gmail.com 2017-05-21
with postgresql you should able to do:
EmailModel.objects.all().order_by('date').distinct('Name')
for more methods/functions like this, you can visit the docs here
This only applies to POSTGRES
You can use the ORDER_BY command to set your query set as ordered by date, then chain with the DISTINCT command to get distinct rows and specify which field. The DISTINCT command will take the first entry for each name. Refer The Docs For More
Edit
For MYSQL, you will have to use raw SQL queries, refer here
Only Postgres supports providing field names in distinct. Also, any field provided in values and order_by is in distinct, thus providing ambiguous results sometimes.
However for MySQL:
Model.objects.values('names').distinct().latest('date')

Repeating Rows in custom list

I'm trying to create a mileage reimbursement log in sharepoint13 but can't use infopath because I was told by my super that it would require licenses for all users. So the form I wanted to create is formatted something like this:
Emp Name_______________
Date____________________
Ceneter Num_____________
======================================================================================
From Dest______________ To Dest____________________ Mile___________________________
click to add row
Total miles_______________________
======================================================================================
trip purpose___________________________________________________________________________
comments________________________________________________________________________________
SUBMIT
I'm having a problem with the center section, id like the from dest, to dest, mile to repeat by clicking the add row link but I can't find much info out there to do this other than using using info path. After I create this I need to set up a workflow to email the director for approval and then once approved send email to finance dept to process form